import service from '@/utils/request'

// @Tags Option
// @Summary 创建选项内容
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Option true "创建选项内容"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /option/createOption [post]
export const createOption = (data) => {
  return service({
    url: '/option/createOption',
    method: 'post',
    data
  })
}

// @Tags Option
// @Summary 删除选项内容
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Option true "删除选项内容"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /option/deleteOption [delete]
export const deleteOption = (data) => {
  return service({
    url: '/option/deleteOption',
    method: 'delete',
    data
  })
}

// @Tags Option
// @Summary 批量删除选项内容
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除选项内容"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /option/deleteOption [delete]
export const deleteOptionByIds = (data) => {
  return service({
    url: '/option/deleteOptionByIds',
    method: 'delete',
    data
  })
}

// @Tags Option
// @Summary 更新选项内容
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Option true "更新选项内容"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /option/updateOption [put]
export const updateOption = (data) => {
  return service({
    url: '/option/updateOption',
    method: 'put',
    data
  })
}

// @Tags Option
// @Summary 用id查询选项内容
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Option true "用id查询选项内容"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /option/findOption [get]
export const findOption = (params) => {
  return service({
    url: '/option/findOption',
    method: 'get',
    params
  })
}

// @Tags Option
// @Summary 分页获取选项内容列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取选项内容列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /option/getOptionList [get]
export const getOptionList = (params) => {
  return service({
    url: '/option/getOptionList',
    method: 'get',
    params
  })
}
